#include <iostream>
#include <cstring>

class student
{
public:

    void setId(int id)
    {
        m_id = id;
    }

    int getId()
    {
        return m_id;
    }

    void setName(char *name)
    {
        m_name = name;
    }

    char* getName()
    {
        return m_name;
    }

    void display()
    {
        std::cout<<"id="<<m_id<<",name="<<m_name<<std::endl;
    }
private:

    int m_id;

    char* m_name;
};


int main()
{
    student stu;

    char* s = new char[20];
    strcpy(s, "小明");

    stu.setId(20);
    stu.setName(s);
    stu.display();

    delete[]s;

    return 0;
}